%%%-------------------------------------------------------------------
%%% @author liuwentao
%%% @doc
%%%        角色数据装换接口
%%% @end
%%% Created : 15. 7月 2021 14:59
%%%-------------------------------------------------------------------
-module(role_convert).
-author("liuwentao").

-export([
    to/2
]).

-include("common.hrl").
-include("role.hrl").
-include("group.hrl").
-include("conn.hrl").

%% @doc 将角色数据转换成其它格式的数据
-spec to(Type, Role) -> {ok, tuple()} | {error, role_convert_unknow_type} when
    Type :: atom(),
    Role :: #role{}.

%% 转为分组成员信息
to(member, #role{pid = Pid, link = #link{conn_pid = ConnPid}}) ->
    {ok, #member{pid = Pid, conn_pid = ConnPid}}.
